// In the main program

#include <spdlog/logger.h>
#include <spdlog/sinks/daily_file_sink.h>
#include <spdlog/sinks/stdout_sinks.h>

#include "mylibrary.h"

int main()
{
    // Let's use the library
    std::vector<spdlog::sink_ptr> sinks;
    sinks.push_back(std::make_shared<spdlog::sinks::stdout_sink_st>());
    sinks.push_back(std::make_shared<spdlog::sinks::daily_file_sink_st>("logfile", 23, 59));

    auto logger = mylibrary::setup_logger(sinks);

    // 使用 DLLs 动态链接, 多个主调方，可以调用同一个 Logger, 不用担心 Logger 被重复创建
    spdlog::set_level(spdlog::level::level_enum::debug);
    mylibrary::test("Hello World!");

    //spdlog::register_logger(logger);

    // Now this will also affect the library logger
    spdlog::set_level(spdlog::level::level_enum::debug);

    mylibrary::test("Hello World!");  // Hurray !

    return 0;
}